package com.datang.petstore.controller.web;
/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-11-19 11:16
 * @notify 宠物类型
 * @version 1.0
 */

import com.datang.petstore.entity.InformCause;
import com.datang.petstore.entity.PetMold;
import com.datang.petstore.resultpage.Result;
import com.datang.petstore.service.InformCauseService;
import com.datang.petstore.service.PetMoldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
public class WebInformCauseController {

    @Autowired
    private InformCauseService informCauseService;


    /*
     * @author 顶风少年
     * @date 2019/11/19 11:19
     * @mail dfsn199703132038@foxmail.com
     * @throws
     * @param
     * @param petMold
     * @result void
     * @notify 添加宠物类型
     * version 1.0
     */
    @PostMapping(value = "/manage/informCause")
    public Result addInformCause(@RequestBody InformCause informCause) {
        informCauseService.addInformCause(informCause);
        return Result.ok();
    }

    /*
     * @author 顶风少年
     * @date 2019/11/19 11:19
     * @mail dfsn199703132038@foxmail.com
     * @throws
     * @param
     * @param petMold
     * @result void
     * @notify 删除宠物类型
     * version 1.0
     */
    @DeleteMapping(value = "/manage/informCause")
    public Result deleteInformCause(@RequestBody InformCause informCause) {
        informCauseService.deleteInformCause(informCause.getId());
        return Result.ok();
    }


    /*
     * @author 顶风少年
     * @date 2019/11/19 11:19
     * @mail dfsn199703132038@foxmail.com
     * @throws
     * @param
     * @param petMold
     * @result void
     * @notify 更改宠物类型
     * version 1.0
     */
    @PutMapping(value = "/manage/informCause")
    public Result updateInformCause(@RequestBody InformCause informCause) {
        informCauseService.updateInformCause(informCause);
        return Result.ok();
    }
}
